﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MaestraVotante.Master" AutoEventWireup="true"
    ValidateRequest="false" ClientIDMode="Static" CodeBehind="Administracion_Votante.aspx.cs"
    Inherits="VotanetWebSite.Acceso_Usuario.Administracion_Votante" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="AdministracionUsuarioHead" ContentPlaceHolderID="headMaestro" runat="server">
    <script src="../../JavaScript/Editor/ckeditor.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="AdministracionUsuarioBody" ContentPlaceHolderID="ContentPlaceHolderMaestro"
    runat="server">
    <script language="javascript" type="text/javascript">

        function MostarEditor(idEmail) {
            $("#hidEmail").val(idEmail);
            $("#editorMail").slideToggle("slow");
        }

        function OcultarEditor() {
            $("#hidEmail").val("0");
            $("#editorMail").slideToggle("slow", function () { location.reload(); });
        }
    </script>
    <asp:UpdatePanel ID="UpdatePanelIngreso" runat="server">
        <ContentTemplate>
            <div class="bordeRedondo">
                <div class="encabezado">
                    <span class="label12">Ingreso Votante</span>
                    <div style="text-align: right;">
                        <asp:Label ID="lblNombreUsuarioLogin" runat="server" Text="" CssClass="label12"></asp:Label>
                        &nbsp;&nbsp;
                        <br />
                        <asp:ImageButton ID="BtnLogout" runat="server" ImageUrl="~/Images/logout.png" ValidationGroup="logout"
                            OnClick="BtnLogout_Click" />
                    </div>
                </div>
                <br />
                <table>
                    <tr>
                        <td>
                            <span class="label12">Rut</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtRut" runat="server" MaxLength="9"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtroTxtRut" runat="server" TargetControlID="txtrut"
                                FilterType="Custom" ValidChars="1234567890" />
                            <asp:RequiredFieldValidator ID="RFVvalidaFormatoRut" runat="server" ControlToValidate="txtRut"
                                Display="None" ErrorMessage="No deje el Rut en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEvalidaRut" runat="server" TargetControlID="RFVvalidaFormatoRut">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="REVRut" runat="server" ControlToValidate="txtRut"
                                Display="None" ErrorMessage="Rut Invalido" ValidationExpression="^0*(\d{1,3}(\.?\d{3})*)\-?([\dkK])$"></asp:RegularExpressionValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValidadFormatoRut" runat="server" TargetControlID="REVRut">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Primer Nombre</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtnombre1" runat="server" MaxLength="30"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtnombre" runat="server" TargetControlID="txtnombre1"
                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                            <asp:RequiredFieldValidator ID="RFVValida1Nombre" runat="server" ControlToValidate="txtnombre1"
                                Display="None" ErrorMessage="No deje el Nombre en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValida1Nombre" runat="server" TargetControlID="RFVValida1Nombre">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td>
                            <span class="label12">Segundo Nombre</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtnombre2" runat="server" MaxLength="30"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtnombre2" runat="server" TargetControlID="txtnombre2"
                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                            <asp:RequiredFieldValidator ID="RFVValida2Nombre" runat="server" ControlToValidate="txtnombre2"
                                Display="None" ErrorMessage="No deje el Nombre en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValida2Nombre" runat="server" TargetControlID="RFVValida2Nombre">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Apellido Paterno</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPaterno" runat="server" MaxLength="30"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtPaterno" runat="server" TargetControlID="txtPaterno"
                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                            <asp:RequiredFieldValidator ID="RFVValidaPaterno" runat="server" ControlToValidate="txtPaterno"
                                Display="None" ErrorMessage="No deje el Apellido en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValidaApellido" runat="server" TargetControlID="RFVValidaPaterno">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td>
                            <span class="label12">Apellido Materno</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtMaterno" runat="server" MaxLength="30"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtMaterno" runat="server" TargetControlID="txtMaterno"
                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                            <asp:RequiredFieldValidator ID="RFVValidaMaterno" runat="server" ControlToValidate="txtMaterno"
                                Display="None" ErrorMessage="No deje el Apellido en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValidaMaterno" runat="server" TargetControlID="RFVValidaMaterno">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Fecha Nacimiento</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtfecha" runat="server" MaxLength="10"></asp:TextBox>
                            <ajaxToolkit:CalendarExtender ID="CalendarioIngreso" runat="server" TargetControlID="txtfecha">
                            </ajaxToolkit:CalendarExtender>
                            <asp:RequiredFieldValidator ID="RFVValidadorFecha" runat="server" ControlToValidate="txtfecha"
                                Display="None" ErrorMessage="No deje la Fecha en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValidadorFecha" runat="server" TargetControlID="RFVValidadorFecha">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="REVValidadorFormatoFecha" runat="server" ControlToValidate="txtfecha"
                                Display="None" ErrorMessage="Fecha Invalida" ValidationExpression="^([0][1-9]|[12][0-9]|3[01])(/|-)(0[1-9]|1[012])\2(\d{4})$"></asp:RegularExpressionValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEValidadorFormatoFecha" runat="server"
                                TargetControlID="REVValidadorFormatoFecha">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td colspan="2">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Email</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtemail" runat="server" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RFVFemail" runat="server" ControlToValidate="txtemail"
                                Display="None" ErrorMessage="No deje el mail en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEemail" runat="server" TargetControlID="RFVFemail">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtroEmail" runat="server" TargetControlID="txtemail"
                                FilterType="Custom" ValidChars="@.qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890_" />
                            <asp:RegularExpressionValidator ID="REVEmail" runat="server" ControlToValidate="txtemail"
                                Display="None" ErrorMessage="Mail Invalida" ValidationExpression="(^[0-9a-zA-Z]+(?:[._][0-9a-zA-Z]+)*)@([0-9a-zA-Z]+(?:[._-][0-9a-zA-Z]+)*\.[0-9a-zA-Z]{2,3})$"></asp:RegularExpressionValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEFormatoEmail" runat="server" TargetControlID="REVEmail">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Direccion</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlcalle" runat="server">
                                <asp:ListItem>Av</asp:ListItem>
                                <asp:ListItem>Calle</asp:ListItem>
                                <asp:ListItem>Pje</asp:ListItem>
                            </asp:DropDownList>
                            &nbsp;
                            <asp:TextBox ID="txtdireccion" runat="server" MaxLength="56"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RFVDireccion" runat="server" ControlToValidate="txtdireccion"
                                Display="None" ErrorMessage="No deje la direccion en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEDireccion" runat="server" TargetControlID="RFVDireccion">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtroDireccion" runat="server" TargetControlID="txtdireccion"
                                FilterType="Custom" ValidChars="#qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890. " />
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlVilla" runat="server">
                                <asp:ListItem>Poblacion</asp:ListItem>
                                <asp:ListItem>Villa</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:TextBox ID="txtVilla" runat="server" MaxLength="40"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RFVVilla" runat="server" ControlToValidate="txtVilla"
                                Display="None" ErrorMessage="No deje la villa en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEVilla" runat="server" TargetControlID="RFVVilla">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtroVilla" runat="server" TargetControlID="txtVilla"
                                FilterType="Custom" ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890. " />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Region</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlRegiones" runat="server">
                            </asp:DropDownList>
                            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="regiones"
                                TargetControlID="ddlRegiones" LoadingText="Cargando Regiones..." ServicePath="~/WS/WSRegionComunne.asmx"
                                ServiceMethod="GetListRegions">
                            </ajaxToolkit:CascadingDropDown>
                        </td>
                        <td>
                            <span class="label12">Comuna</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlComunas" runat="server">
                            </asp:DropDownList>
                            <ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="comunas"
                                TargetControlID="ddlComunas" ParentControlID="ddlRegiones" LoadingText="Cargando Comunas..."
                                ServicePath="~/WS/WSRegionComunne.asmx" ServiceMethod="GetListCommunes">
                            </ajaxToolkit:CascadingDropDown>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Telefono</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlTelefonos" runat="server">
                                <asp:ListItem>02</asp:ListItem>
                                <asp:ListItem>32</asp:ListItem>
                                <asp:ListItem>33</asp:ListItem>
                                <asp:ListItem>34</asp:ListItem>
                                <asp:ListItem>35</asp:ListItem>
                                <asp:ListItem>39</asp:ListItem>
                                <asp:ListItem>41</asp:ListItem>
                                <asp:ListItem>42</asp:ListItem>
                                <asp:ListItem>43</asp:ListItem>
                                <asp:ListItem>45</asp:ListItem>
                                <asp:ListItem>58</asp:ListItem>
                                <asp:ListItem>57</asp:ListItem>
                                <asp:ListItem>55</asp:ListItem>
                                <asp:ListItem>51</asp:ListItem>
                                <asp:ListItem>52</asp:ListItem>
                                <asp:ListItem>53</asp:ListItem>
                                <asp:ListItem>63</asp:ListItem>
                                <asp:ListItem>64</asp:ListItem>
                                <asp:ListItem>65</asp:ListItem>
                                <asp:ListItem>67</asp:ListItem>
                                <asp:ListItem>61</asp:ListItem>
                                <asp:ListItem>72</asp:ListItem>
                                <asp:ListItem>71</asp:ListItem>
                                <asp:ListItem>73</asp:ListItem>
                                <asp:ListItem>75</asp:ListItem>
                            </asp:DropDownList>
                            -
                            <asp:TextBox ID="txtTelefono" runat="server" MaxLength="7"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtTelefono" runat="server" TargetControlID="txtTelefono"
                                ValidChars="0123456789" />
                            <asp:RequiredFieldValidator ID="RFVTelefono" runat="server" ControlToValidate="txtTelefono"
                                Display="None" ErrorMessage="No deje el Telefono en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCETelefono" runat="server" TargetControlID="RFVTelefono">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                        <td>
                            <span class="label12">Celular</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCelulares" runat="server">
                                <asp:ListItem>06</asp:ListItem>
                                <asp:ListItem>07</asp:ListItem>
                                <asp:ListItem>08</asp:ListItem>
                                <asp:ListItem>09</asp:ListItem>
                            </asp:DropDownList>
                            -
                            <asp:TextBox ID="txtCelular" runat="server" MaxLength="7"></asp:TextBox>
                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtCelular" runat="server" TargetControlID="txtCelular"
                                ValidChars="0123456789" />
                            <asp:RequiredFieldValidator ID="RFVCelular" runat="server" ControlToValidate="txtCelular"
                                Display="None" ErrorMessage="No deje el Celular en blanco"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender ID="VCECelular" runat="server" TargetControlID="RFVCelular">
                            </ajaxToolkit:ValidatorCalloutExtender>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="label12">Sexo</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlSexo" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <span class="label12">Estado Civil</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlEstadoCivil" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
                <br />
                <span class="label12">Grupos</span>
                <br />
                <br />
                <div style="max-width: 50%">
                    <div class="grid" style="max-width: 100%">
                        <div class="rounded">
                            <div class="mid-outer">
                                <div class="mid-inner">
                                    <div class="mid">
                                        <asp:GridView ID="GrillaGrupos" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                            CellPadding="0" CssClass="datatable" CellSpacing="0" BorderWidth="0" GridLines="None"
                                            PageSize="10" ShowFooter="true">
                                            <EmptyDataRowStyle />
                                            <EmptyDataTemplate>
                                                <span class="label12Black">No exiten Grupos</span>
                                            </EmptyDataTemplate>
                                            <PagerStyle CssClass="pager-row" />
                                            <RowStyle CssClass="row" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:HiddenField ID="HiDVo" runat="server" Value='<%# Eval("id") %> ' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Grupo">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblnombreVotacion" runat="server" Text='<%# Eval("name") %> '></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Asignar Grupo">
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="checkVotante" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <br />
                <br />
                <asp:Button ID="btnGuardar" runat="server" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                    OnClick="btnGuardar_Click" Text="Guardar" />
                &nbsp;
                <asp:Button ID="BtnCancelar" runat="server" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                    Enabled="false" OnClick="BtnCancelar_Click" Text="Cancelar" Visible="false" />
            </div>
            <asp:HiddenField ID="HiddenFieldUsuario" runat="server" Value="0" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div id="editorMail" style="display: none;">
        <asp:TextBox ID="txtEditorEmail" runat="server" TextMode="MultiLine"></asp:TextBox>
        <script type="text/javascript">
            CKEDITOR.replace('txtEditorEmail', { toolbar: 'Basic' });
        </script>
        <br />
        <asp:Button ID="BtnEnviarMail" runat="server" Text="Enviar" OnClick="BtnEnviarMail_Click"
            ValidationGroup="GrupoEnviarMail" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
        <input id="BtnCancelarMail" type="button" value="Cancelar" onclick="OcultarEditor()"
            class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
    </div>
    <asp:HiddenField ID="hidIdUsuario" runat="server" Value="0" />
    <asp:HiddenField ID="hidEmail" runat="server" Value="0" />
    <asp:UpdateProgress ID="UpdateProgressVotante" runat="server" AssociatedUpdatePanelID="UpdatePanelIngreso">
        <ProgressTemplate>
            <table width="970px">
                <tr>
                    <td>
                        <center>
                            Enviando Datos... Espere un momento por favor..<br />
                            <img src="../Images/cargando.gif" alt="" />
                        </center>
                    </td>
                </tr>
            </table>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div class="bordeRedondo">
        <div class="encabezado">
            <span class="label12">Lista Votantes</span>
        </div>
    </div>
    <div class="grid">
        <div class="rounded">
            <div class="mid-outer">
                <div class="mid-inner">
                    <div class="mid">
                        <asp:UpdatePanel ID="UpdatePanelGrilla" runat="server">
                            <ContentTemplate>
                                <asp:GridView ID="GridListaVotante" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                    CellPadding="0" CssClass="datatable" CellSpacing="0" BorderWidth="0" GridLines="None"
                                    OnPageIndexChanging="GridListaVotante_PageIndexChanging" PageSize="10" ShowFooter="true"
                                    Width="1167px" ShowHeaderWhenEmpty="true">
                                    <EmptyDataRowStyle />
                                    <EmptyDataTemplate>
                                        <span class="label12Black">No exiten Votantes</span>
                                    </EmptyDataTemplate>
                                    <PagerStyle CssClass="pager-row" />
                                    <RowStyle CssClass="row" />
                                    <PagerSettings Mode="NumericFirstLast" PageButtonCount="7" FirstPageText="«" LastPageText="»" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Rut">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Rut
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxRut" runat="server" ValidationGroup="BuscarRut" Width="100"
                                                                MaxLength="9"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtroTxtRutBuscar" runat="server" TargetControlID="textboxRut"
                                                                FilterType="Custom" ValidChars="1234567890" />
                                                            <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteRut" ID="autoCompleteRut"
                                                                TargetControlID="textboxRut" ServicePath="~/WS/WSAutocompleteVoter.asmx" ServiceMethod="AutocompleteRut"
                                                                MinimumPrefixLength="2" CompletionInterval="50" EnableCaching="true" CompletionSetCount="20"
                                                                CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
                                                                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                <Animations>
                                                    <OnShow>
                                                        <Sequence>
                                                          <OpacityAction Opacity="8" />
                                                            <HideAction Visible="true" />
                            
                                                            <Parallel Duration=".4">
                                                                <FadeIn />
                                                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteRut')._height" />
                                                            </Parallel>
                                                        </Sequence>
                                                    </OnShow>
                                                    <OnHide>
                                                    <Parallel Duration=".4">
                                                            <FadeOut />
                                                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteRut')._height" EndValue="0" />
                                                        </Parallel>
                                                    </OnHide>
                                                                </Animations>
                                                            </ajaxToolkit:AutoCompleteExtender>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarRut" runat="server" ValidationGroup="BuscarRut" CommandName="rut"
                                                                OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelRut" runat="server" Text='<%# Bind("rut") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Nombre">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Nombre
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxNombre" runat="server" ValidationGroup="BuscarNombre" Width="100"
                                                                MaxLength="30"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotxtnombreBuscar" runat="server" TargetControlID="textboxNombre"
                                                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                                                            <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteNombre"
                                                                ID="autoCompleteNombre" TargetControlID="textboxNombre" ServicePath="~/WS/WSAutocompleteVoter.asmx"
                                                                ServiceMethod="AutocompleteName" MinimumPrefixLength="2" CompletionInterval="50"
                                                                EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"
                                                                CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                <Animations>
                                                    <OnShow>
                                                        <Sequence>
                                                          <OpacityAction Opacity="8" />
                                                            <HideAction Visible="true" />
                            
                                                            <Parallel Duration=".4">
                                                                <FadeIn />
                                                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteNombre')._height" />
                                                            </Parallel>
                                                        </Sequence>
                                                    </OnShow>
                                                    <OnHide>
                                                    <Parallel Duration=".4">
                                                            <FadeOut />
                                                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteNombre')._height" EndValue="0" />
                                                        </Parallel>
                                                    </OnHide>
                                                                </Animations>
                                                            </ajaxToolkit:AutoCompleteExtender>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarNombre" runat="server" ValidationGroup="BuscarNombre"
                                                                CommandName="nombre" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelNombre" runat="server" Text='<%# Bind("name") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Apellido">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Apellido
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxApellido" runat="server" ValidationGroup="BuscarApellido"
                                                                Width="100" MaxLength="30"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotextboxApellido" runat="server" TargetControlID="textboxApellido"
                                                                ValidChars="qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑZXCVBNM" />
                                                            <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteApellido"
                                                                ID="autoCompleteApellido" TargetControlID="textboxApellido" ServicePath="~/WS/WSAutocompleteVoter.asmx"
                                                                ServiceMethod="AutocompleteLastName" MinimumPrefixLength="2" CompletionInterval="50"
                                                                EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement"
                                                                CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                <Animations>
                                                    <OnShow>
                                                        <Sequence>
                                                          <OpacityAction Opacity="8" />
                                                            <HideAction Visible="true" />
                            
                                                            <Parallel Duration=".4">
                                                                <FadeIn />
                                                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteApellido')._height" />
                                                            </Parallel>
                                                        </Sequence>
                                                    </OnShow>
                                                    <OnHide>
                                                    <Parallel Duration=".4">
                                                            <FadeOut />
                                                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteApellido')._height" EndValue="0" />
                                                        </Parallel>
                                                    </OnHide>
                                                                </Animations>
                                                            </ajaxToolkit:AutoCompleteExtender>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarApellido" runat="server" ValidationGroup="BuscarApellido"
                                                                CommandName="apellido" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelApellido" runat="server" Text='<%# Bind("lastName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Email">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Email
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxEmail" runat="server" ValidationGroup="BuscarEmail" Width="100"
                                                                MaxLength="50"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrtextboxEmail" runat="server" TargetControlID="textboxEmail"
                                                                FilterType="Custom" ValidChars="@.qwertyuiopasdfghjklñzxcvbnmQWERTYUIOPASDFGHJKLÑXCVBNM1234567890_" />
                                                            <asp:RegularExpressionValidator ID="REVEtextboxEmail" runat="server" ControlToValidate="textboxEmail"
                                                                ValidationGroup="BuscarEmail" Display="None" ErrorMessage="Mail Invalida" ValidationExpression="(^[0-9a-zA-Z]+(?:[._][0-9a-zA-Z]+)*)@([0-9a-zA-Z]+(?:[._-][0-9a-zA-Z]+)*\.[0-9a-zA-Z]{2,3})$"></asp:RegularExpressionValidator>
                                                            <ajaxToolkit:ValidatorCalloutExtender ID="VCEtextboxEmail" runat="server" TargetControlID="REVEtextboxEmail"
                                                                PopupPosition="TopLeft" />
                                                            <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEmail" ID="autoCompleteEmail"
                                                                TargetControlID="textboxEmail" ServicePath="~/WS/WSAutocompleteVoter.asmx" ServiceMethod="AutocompleteEmail"
                                                                MinimumPrefixLength="2" CompletionInterval="50" EnableCaching="true" CompletionSetCount="20"
                                                                CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
                                                                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem">
                                                                <Animations>
                                                    <OnShow>
                                                        <Sequence>
                                                          <OpacityAction Opacity="8" />
                                                            <HideAction Visible="true" />
                            
                                                            <Parallel Duration=".4">
                                                                <FadeIn />
                                                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEmail')._height" />
                                                            </Parallel>
                                                        </Sequence>
                                                    </OnShow>
                                                    <OnHide>
                                                    <Parallel Duration=".4">
                                                            <FadeOut />
                                                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEmail')._height" EndValue="0" />
                                                        </Parallel>
                                                    </OnHide>
                                                                </Animations>
                                                            </ajaxToolkit:AutoCompleteExtender>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarEmail" runat="server" ValidationGroup="BuscarEmail"
                                                                CommandName="email" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelEmail" runat="server" Text='<%# Bind("email") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Telefono">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Telefono
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxTelefono" runat="server" ValidationGroup="BuscarTelefono"
                                                                Width="80" MaxLength="9"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotextboxTelefono" runat="server" TargetControlID="textboxTelefono"
                                                                ValidChars="0123456789" />
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarTelefono" runat="server" ValidationGroup="BuscarTelefono"
                                                                CommandName="telefono" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelTelefono" runat="server" Text='<%# Bind("telephone") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Celular">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Celular
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxCelular" runat="server" ValidationGroup="BuscarCelular" Width="80"
                                                                MaxLength="9"></asp:TextBox>
                                                            <ajaxToolkit:FilteredTextBoxExtender ID="filtrotextboxCelular" runat="server" TargetControlID="textboxCelular"
                                                                ValidChars="0123456789" />
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarCelular" runat="server" ValidationGroup="BuscarCelular"
                                                                CommandName="celular" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelCelular" runat="server" Text='<%# Bind("cellphone") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Fecha Inscripcion">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Fecha Inscripcion
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:TextBox ID="textboxFecha" runat="server" ValidationGroup="BuscarFecha" Width="80"
                                                                MaxLength="10"></asp:TextBox>
                                                            <ajaxToolkit:CalendarExtender ID="Calendario" runat="server" TargetControlID="textboxFecha">
                                                            </ajaxToolkit:CalendarExtender>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarFecha" runat="server" ValidationGroup="BuscarFecha"
                                                                CommandName="fecha" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelFecha" runat="server" Text='<%# Bind("dateView") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Bloqueado">
                                            <HeaderTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            Bloqueado
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:DropDownList ID="ddlBloqueado" runat="server" ValidationGroup="BuscarBloqueado">
                                                                <asp:ListItem>Si</asp:ListItem>
                                                                <asp:ListItem>No</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnBuscarBloqueado" runat="server" ValidationGroup="BuscarBloqueado"
                                                                CommandName="bloqueado" OnClick="BotonBuscar_Click" ImageUrl="~/Images/search.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="LabelBloqueado" runat="server" Text='<%# Bind("blockedView") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Enviar</br>Email">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="ImageButtonEmail" runat="server" ImageUrl="~/Images/email_del.ico"
                                                    ValidationGroup="emailUsuario" OnClientClick='<%# "MostarEditor(&#39;" + Eval("id")+"&#39;)" %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField>
                                            <FooterTemplate>
                                                <asp:ImageButton ID="BtnActualizar" runat="server" ImageUrl="~/Images/actualizar.ico"
                                                    AlternateText="Actualizar" ToolTip="Actualizar" OnClick="BtnActualizar_Click"
                                                    ValidationGroup="actualizar" />
                                            </FooterTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </span>
</asp:Content>
